﻿namespace Marc.JwOrgClient.Model {
    using System;

    public abstract class MagazineType {
        public abstract string DownloadKey { get; }
        public abstract string Name { get; }
        public abstract string FormatPublishedDate(DateTime publishedDate);

        public static readonly MagazineType Awake = new AwakeImpl();
        public static readonly MagazineType Watchtower = new WatchtowerImpl();
        public static readonly MagazineType WatchtowerStudyEdition = new WatchtowerStudyEditionImpl();
        
        private class AwakeImpl : MagazineType {
            public override string DownloadKey {
                get { return "g"; }
            }

            public override string Name {
                get { return "Erwachet!"; }
            }

            public override string FormatPublishedDate(DateTime publishedDate) {
                return string.Format("{0:MMMM yyyy}", publishedDate);
            }
        }

        private class WatchtowerStudyEditionImpl : MagazineType {
            public override string DownloadKey {
                get { return "w"; }
            }

            public override string Name {
                get { return "Der Wachtturm (Studienausgabe)"; }
            }

            public override string FormatPublishedDate(DateTime publishedDate) {
                return string.Format("{0:dd. MMMM yyyy}", publishedDate);
            }
        }

        private class WatchtowerImpl : MagazineType {
            public override string DownloadKey {
                get { return "wp"; }
            }

            public override string Name {
                get { return "Der Wachtturm"; }
            }

            public override string FormatPublishedDate(DateTime publishedDate) {
                return string.Format("{0:dd. MMMM yyyy}", publishedDate);
            }
        }
    }
}